<template>
  <div class="sys">
    <el-button v-if="isAdmin" type="text" :style="{color: model === 'study' ? '#409EFF' : 'grey'}" @click="jumpTo('/study')">学习管理</el-button>
    <el-button type="text" :style="{color: model === 'project' ? '#409EFF' : 'grey'}" @click="jumpTo('/')">项目管理
    </el-button>
    <el-button v-if="isAdmin" type="text" :style="{color: model === 'system' ? '#409EFF' : 'grey'}" @click="jumpTo('/system')">系统设置
    </el-button>
  </div>
</template>

<script>
  import { mapGetters } from 'vuex'
  export default {
    computed: {
      ...mapGetters([
        'isAdmin',
      ])
    },
    name: 'Index',
    props: ['model'],
    methods: {
      jumpTo(to) {
        this.$router.push(to)
      },
      changeMode() {
        switch (this.model) {
          case 'system':
            this.$router.push('/system')
            break
          default:
            this.$router.push('/')
            break
        }
      }
    }
  }
</script>

<style scoped>
  .sys {
    display: inline-block;
    cursor: pointer;
    fill: #5a5e66;;
    vertical-align: 15px;
    margin-right: 15px;
  }
</style>
